package com.bp.hearthealth.pulse.lnapps.appsflyer

import com.appsflyer.AppsFlyerLib
import com.appsflyer.attribution.AppsFlyerRequestListener
import com.bp.hearthealth.pulse.lnapps.BpApplication
import com.bp.hearthealth.pulse.lnapps.bp_extension.LogUtil

object AppsFlyerUtils {
    fun trackEvent(placeName: String) {
        val eventValues: MutableMap<String, Any> = HashMap()
        eventValues[placeName] = "1"
        AppsFlyerLib.getInstance().logEvent(
            BpApplication.context,
            placeName, eventValues, object : AppsFlyerRequestListener {
                override fun onSuccess() {
//                    LogUtil.i("事件：$placeName 记录成功")
                }

                override fun onError(p0: Int, p1: String) {
                    LogUtil.e("事件：$placeName 记录失败")
                }
            }
        )
    }
}